#pragma once 

#include <sfml/System.hpp>
#include <sfml/Graphics.hpp>
#include <list>

typedef sf::Uint32 uint32;
typedef sf::Uint16 uint16;
typedef sf::Uint8   uint8;

typedef sf::Int32   int32;
typedef sf::Int16   int16;
typedef sf::Int8	 int8;

#define RETURN_ERROR -1

enum VisualPackType {
	VISUAL_TYPE_NONE,
	VISUAL_TYPE_BUILDING,
	VISUAL_TYPE_UNIT
};
struct Rect {
	Rect(int X=0, int Y=0,int W=0, int H=0): x(X),y(Y), w(W), h(H) {}
	Rect(const sf::Vector2i& pos, const sf::Vector2i& size) { x = pos.x; y = pos.y; w = size.x; h = size.y; }
	Rect(const sf::Vector2f& pos, const sf::Vector2f& size) { x = (int)pos.x; y = (int)pos.y; w = (int)size.x; h = (int)size.y;}
	Rect(const sf::IntRect& rect) { x = rect.Left; y = rect.Top; w = rect.GetWidth(); h = rect.GetHeight(); }
	operator sf::IntRect() const;
	int x,y,w,h;
};
std::ostream& operator<<( std::ostream& os, const Rect& rect);
std::stringstream& operator << (std::stringstream& ss, const Rect& rect);

//counter clock-wise..
enum UnitVisuals {
	UNIT_SOUTH,
	UNIT_SOUTH_WEST,
	UNIT_WEST,
	UNIT_NORTH_WEST,
	UNIT_NORTH,
	UNIT_NORTH_EAST,
	UNIT_EAST,
	UNIT_SOUTH_EAST
};

enum MouseMapDirection {
	MM_NE,				
	MM_NW,
	MM_CENTER,	
	MM_SW, 
	MM_SE
};

enum IsoDirection {
	ISO_NORTH,
	ISO_SOUTH,
	ISO_WEST,
	ISO_EAST,
	ISO_NORTHEAST,
	ISO_NORTHWEST,
	ISO_SOUTHEAST,
	ISO_SOUTHWEST
};

sf::Vector2f GetIsoHotspot(const sf::Vector2f& pos, const sf::Vector2i& size);
bool IsCollision(const Rect& first, const Rect& second);